package com.bw.unit6

import android.content.Context
import android.widget.ImageView
import com.bw.unit6.bean.GoodsBean
import com.bw.unit6.util.GlideUtil
import com.zhy.adapter.recyclerview.CommonAdapter
import com.zhy.adapter.recyclerview.base.ViewHolder

/**
 *
 * @ClassName: HomeGoodsAdapter
 * @Description: 首页，商品列表适配器
 * @Author: zhangyanchao
 * @CreateDate: 2024/9/19 5:18 PM
 * @Version: 1.0
 */
class GoodsAdapter(
    context: Context?, itemLayoutId: Int, mData: List<GoodsBean>
) : CommonAdapter<GoodsBean>(context, itemLayoutId, mData) {
    override fun convert(holder: ViewHolder?, t: GoodsBean?, position: Int) {
        holder?.setText(R.id.tv_goods, mDatas[position-1].goods_desc)
        val imageView = holder?.getView<ImageView>(R.id.iv)

        GlideUtil.loadImg(mContext,t?.goods_default_icon!!,imageView!!)
//        imageView?.let { Glide.with(mContext).load(t?.goods_default_icon).into(it) }

    }
}